const posController = require('../controller/posController')
//引入业务逻辑层
const express = require('express')
//创建路由对象
const multer = require('multer')
const path = require('path')
//将上传的文件companyLogo图片放入到public/upload目录之中
let up = path.resolve(__dirname,'../public/upload')
var upload = multer({ dest:up})
const router = express.Router()

//   /api/position/add post接口
//  mvc分层理念  r:router m:model v:view  c:controller
router.post('/add',upload.single('companyLogo'),posController.add)
router.get('/find',posController.find)
router.get('/:id',posController.findById)
router.post('/update',upload.single('companyLogo'),posController.update)

module.exports = router